#include"stdio.h"

int main()
{
    int n, t;
    t = 1;
    scanf_s("%d", &n);
    if (n == 2)
        t = 1;
    else if (n % 2 == 0)
        t = 0;
    else
    {
        for (int i = 3; i * i <= n; i += 2)
        {
            if (n % i == 0)
                t = 0;
            
        }
    }
    if (t == 1)
        printf("Yes");
    else
        printf("No");
    return 0;
}